package nothing.model;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public class RecipeCost {


    private Recipe recipe;
    private BigDecimal cost;
    private List<Food> unKnownFoodCost;
    private List<MeasurementRatio> unKnownRatio;
    private Date date;

    public RecipeCost() {
    }

    public RecipeCost(Recipe recipe, BigDecimal cost, Date d,
            List<Food> unKnownFoodCost, 
            List<MeasurementRatio> unKnownRatio){
        this.recipe = recipe;
        this.cost = cost;
        this.date = d;
        this.unKnownFoodCost = unKnownFoodCost;
        this.unKnownRatio = unKnownRatio;
    }
    
    public List<Food> getUnKnownFoodCost() {
        return unKnownFoodCost;
    }

    public void setUnKnownFoodCost(List<Food> unKnownFoodCost) {
        this.unKnownFoodCost = unKnownFoodCost;
    }

    public List<MeasurementRatio> getUnKnownRatio() {
        return unKnownRatio;
    }

    public void setUnKnownRatio(List<MeasurementRatio> unKnownRatio) {
        this.unKnownRatio = unKnownRatio;
    }

    public Recipe getRecipe() {
        return recipe;
    }

    public void setRecipe(Recipe recipe) {
        this.recipe = recipe;
    }

    public BigDecimal getCost() {
        return cost;
    }

    public void setCost(BigDecimal cost) {
        this.cost = cost;
    }

    public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((cost == null) ? 0 : cost.hashCode());
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		result = prime * result + ((recipe == null) ? 0 : recipe.hashCode());
		result = prime * result
				+ ((unKnownFoodCost == null) ? 0 : unKnownFoodCost.hashCode());
		result = prime * result
				+ ((unKnownRatio == null) ? 0 : unKnownRatio.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RecipeCost other = (RecipeCost) obj;
		if (cost == null) {
			if (other.cost != null)
				return false;
		} else if (!cost.equals(other.cost))
			return false;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (recipe == null) {
			if (other.recipe != null)
				return false;
		} else if (!recipe.equals(other.recipe))
			return false;
		if (unKnownFoodCost == null) {
			if (other.unKnownFoodCost != null)
				return false;
		} else if (!unKnownFoodCost.equals(other.unKnownFoodCost))
			return false;
		if (unKnownRatio == null) {
			if (other.unKnownRatio != null)
				return false;
		} else if (!unKnownRatio.equals(other.unKnownRatio))
			return false;
		return true;
	}

	public String toString() {
        return "Recipe cost{" +
                "recipe=" + recipe + ", " +
                "cost=" + cost +
                "date=" + date +
                "}";
    }
}
